<?php
if(!check_manager_login()) exit('无权查看，请登录!');
require_once(MODEL_PATH.DS.'Category.php');
$Category = new Category();
$pid = isset($_GET['pid'])?(int)$_GET['pid']:0;
$page = isset($_GET['page'])?(int)$_GET['page']:1;
$limit = 20;
$start = $page * $limit - $limit;
$cat_list = $Category->getCategoryByPid($pid,$start,$limit);
$num = $Category->countCategories();
if(count($cat_list)>=$limit || $page >1){
	$url   = get_page_url();
	$pages = get_pagehtml($num, $limit, $page, $url);
}

include load_tpl('category_list');
?>